﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ROL Report.aspx.cs"  Culture="en-GB" Inherits="Main_Reports_Inventory_ROL_Report" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControl" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../../Styles/accounts.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true">
        </asp:ScriptManager>
        <acc:heading ID="pagehead" runat="server" HeadingText="Re-Order Level Report" />
        <div style="width: 98%;">
             <table style="background-color: #EEEEEE; width: 130%; height: 30px;">
                <tr>
                    <td style="width:5%;">
                        <asp:Label ID="lblRecordNo" runat="server"></asp:Label>
                    </td>
                    <td style="width:12%;">
                        <asp:Label ID="lblperiod" runat="server"></asp:Label>
                    </td>
                    <td style="width:7%;">
                        <span>From</span>
                    </td>
                    <td style="width:2%;">
                        <asp:TextBox ID="txtfromdate" CssClass="input" Width="80px" runat="server"></asp:TextBox>
                    </td>
                    <td style="width:2%;">
                        <asp:ImageButton ID="imgfromdate" runat="server" ImageUrl="~/Images/calendar.gif" />
                        <AjaxControl:CalendarExtender ID="calFrom" runat="server" PopupButtonID="imgfromdate"
                            Format="dd/MM/yyyy" TargetControlID="txtfromdate">
                        </AjaxControl:CalendarExtender>
                    </td>
                    <td style="width:2%;">
                        To
                    </td>
                    <td style="width:2%;">
                        <asp:TextBox ID="txttodate" CssClass="input" Width="80px" runat="server" onKeyPress="return isNumberKey(this.id,event);"></asp:TextBox>
                    </td>
                    <td style="width:2%;">
                        <asp:ImageButton ID="imgtoDate" runat="server" ImageUrl="~/Images/calendar.gif" />
                        <AjaxControl:CalendarExtender ID="calto" runat="server" PopupButtonID="imgtoDate"
                            Format="dd/MM/yyyy" TargetControlID="txttodate">
                        </AjaxControl:CalendarExtender>
                    </td>
                    <td style="width:5%;">
                        <asp:Button ID="btngetreport" runat="server" Text="Report" CssClass="button1" OnClick="btngetreport_Click"
                            OnClientClick="return getcheck();" />
                        <script type="text/javascript">
                            function getcheck() {
                                if (document.getElementById("txtfromdate").value == '') {
                                    alert("Please Select From Date.");
                                    document.getElementById("txtfromdate").focus();
                                    return false;
                                }
                                else if (document.getElementById("txttodate").value == '') {
                                    alert("Please Select To Date.");
                                    document.getElementById("txttodate").focus();
                                    return false;
                                }
                            }
                        </script>
                    </td>                   
                    <td align="right" style="width:6%;">
                        <asp:Label ID="lblcolumnName" runat="server" style="display:none;" Text="Column Name"></asp:Label>
                    </td>
                    <td style="width:10%;">
                        <asp:DropDownList ID="ddlColumnname" style="display:none;" runat="server" onchange="return ToHide_Show();"
                            CssClass="dropdown">
                            <asp:ListItem Value="0"> - Select Column(s) - </asp:ListItem>
                            <asp:ListItem Value="1">Item Code</asp:ListItem>
                            <asp:ListItem Value="2">Item Name</asp:ListItem>
                            <asp:ListItem Value="3">PO Number</asp:ListItem>
                            <asp:ListItem Value="4">Currency</asp:ListItem>
                            <asp:ListItem Value="5">Folio No</asp:ListItem>
                            <asp:ListItem Value="6">Vendor Country</asp:ListItem>
                            <asp:ListItem Value="7">Invoice Value</asp:ListItem>
                            <asp:ListItem Value="8">Payment Terms</asp:ListItem>
                        </asp:DropDownList>
                        <script type="text/javascript">
                            function ToHide_Show() {
                                if (document.getElementById("ddlColumnname").value != "0") {
                                    //document.getElementById("txtValue").style["display"] = "block";
                                    //document.getElementById("lblvalue").style["display"] = "block";
                                    //document.getElementById("btnReport").style["display"] = "block";                                                    
                                }
                                else {
                                    //document.getElementById("txtValue").style["display"] = "none";
                                    //document.getElementById("lblvalue").style["display"] = "none";
                                    //document.getElementById("btnReport").style["display"] = "none";
                                }
                                document.getElementById("txtValue").value = '';
                            }
                        </script>
                    </td>
                    <td align="right" style="width:2%;">
                        <asp:Label ID="lblvalue" runat="server" style="display:none;" Text="Value"></asp:Label>
                    </td>
                    <td style="width:5%;">
                        <asp:TextBox ID="txtValue" CssClass="input" style="display:none;" width="80px" runat="server"></asp:TextBox>
                    </td>
                    <td style="width:3%;">
                        <asp:Button ID="btnSearch" runat="server" Text="Search" style="display:none;" CssClass="button1" OnClick="btnSearch_Click" />
                    </td>
                    <td style="width:3%;" align="center">
                        <asp:ImageButton ID="imgbtnPrint" ToolTip="Print" style="display:none;" runat="server" Width="20px" OnClientClick="printpanel();"
                            ImageUrl="../../../Images/print.png" />
                        <script type="text/javascript">
                            function printpanel() {
                                var printcontent = document.getElementById('grdViewPoStatus');
                                window.print(printcontent.innerHTML);
                            }
                        </script>
                    </td>
                    <td style="width:3%; vertical-align:middle;" align="center">
                        <asp:ImageButton ID="ImgBtnExcel" ToolTip="Export to Excel" style="display:none;" runat="server" Width="20px"
                            ImageUrl="~/Images/Excel.png" OnClick="ImgBtnExcel_Click" />
                    </td>
                </tr>
            </table>
            <asp:GridView ID="grdVIewROL" runat="server" AutoGenerateColumns="false" EmptyDataText="No Record Found !!"
                Width="99%" CssClass="gridview">
                <Columns>
                    <asp:TemplateField HeaderText="S.no">
                        <ItemTemplate>
                            <%#Container.DataItemIndex+1 %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="BinRef" HeaderText="Bin Ref" />
                    <asp:BoundField DataField="Locationid" HeaderText="Location" />
                    <asp:BoundField DataField="ITMCODE" HeaderText="Item Code" />
                    <asp:BoundField DataField="ITMDESC" HeaderText="Item Name" />
                    <asp:BoundField DataField="ITMALTDESC" HeaderText="Alt Item Code" />
                    <asp:BoundField DataField="projectname" HeaderText="Project" />
                    <asp:BoundField DataField="MPNNO" HeaderText="MPN" />
                    <asp:BoundField DataField="REORDERQTY" HeaderText="ROL" DataFormatString="{0:0}" ItemStyle-HorizontalAlign="Right" />
                    <asp:BoundField DataField="TOTALTRANSITTIME" HeaderText="Total Lead Time" ItemStyle-HorizontalAlign="Right" />                    
                    <asp:BoundField HeaderText="Closing Qty" DataField="closingqty" DataFormatString="{0:0}" ItemStyle-HorizontalAlign="Right"  />
                    <asp:BoundField HeaderText="Closing Value" DataField="closingvalue" ItemStyle-HorizontalAlign="Right"  />                    
                </Columns>
            </asp:GridView>
        </div>
    </div>
    </form>
</body>
</html>
